﻿/// <reference path="_namespace.js" />
//TODO: Change (global replace) "myAjaxApp" Application namespace to your preference and set the application folder.

/*****************************************************************************
Ajaxna program definition.
Author: Win7 8/4/2011 2:32:02 AM.
File:   SoundSample
*****************************************************************************/

$addApplication("soundSample", "/soundSample");
//-----------------------------------------------------------------------------

// program - main entry point
function main()
{
    var snd = $new("ajax.effects.SoundPlayer", document, "Media/vr.mp3");

    // Loop infinitely.
    snd.setLoop(-1);

    var btnPlay = document.getElementById("btnPlay");
    $getEvent(window, btnPlay, "onclick").addListener(function() { snd.play(); });
    var btnPause = document.getElementById("btnPause");
    $getEvent(window, btnPause, "onclick").addListener(function() { snd.pause(); });
    var btnStop = document.getElementById("btnStop");
    $getEvent(window, btnStop, "onclick").addListener(function() { snd.stop(); });
    
    document.getElementById("status").innerHTML = "Using Audio tag = " + ajax.effects.SoundPlayer.hasAudio;
}

// use the window load event to start us off.
$getEvent(window, window, "onload").addListener(main);

